<%@ page import="java.io.PrintWriter" %><%--
  Created by IntelliJ IDEA.
  User: pinecone
  Date: 2024/9/23
  Time: 21:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--
    ctrl +shift + /
    JSP中通过<%%>来穿插JAVA代码
    <%=变量/值%>将变量/值打印到页面上的标签显示的位置
    访问URL: http://localhost:8080/servlet_jsp01_Web_exploded/test02.jsp
--%>
<%
    int score = (int) (Math.random() * 101);
%>
分数：
<%
    // PrintWriter out = response.getWriter();
    out.print(score);
%>
<br/>
等级：
<%
    int grade = score / 10;
    switch (grade) {
        case 10:
        case 9:
            out.print("A");
            break;
        case 8:
            out.print("B");
            break;
        case 7:
            out.print("C");
            break;
        case 6:
            out.print("D");
            break;
        default:
            out.print("E");
    }
%>
</body>
</html>
